package com.tao.springcloud.controller;

import com.tao.springcloud.entities.CommonResult;
import com.tao.springcloud.entities.Payment;
import com.tao.springcloud.service.Provider8001;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName OrderController
 * @Author HETAO
 * @Date 2020/5/10 14:49
 */
@RestController
@RequestMapping("feign")
public class OrderController {
    @Autowired
    private Provider8001 provider8001;

    @GetMapping("get/{id}")
    public CommonResult<Payment> get(@PathVariable("id") Long id) {
        CommonResult<Payment> result = provider8001.getPaymentById(id);
        return result;
    }

    @GetMapping("timeout")
    public String timeout() {
        return provider8001.timeout();
    }
}
